#include "socket.h"
#include <fcntl.h>
Socket::Socket()
{
	iSocketFD = -1;
}

Socket::Socket(unsigned int fd)
{
	iSocketFD = fd;
}

int Socket::SetSocketFD(unsigned int fd){
	iSocketFD = fd;
	return 0;
}
int Socket::GetSocketFD(){
	//printf("in socket fd %d\n",iSocketFD);
	return iSocketFD;
}

int Socket::IsServerSocket(){
	return 0;
}
int Socket::Read(void *buf,unsigned int nbytes){
	return read(iSocketFD,buf,nbytes);
}
int Socket::Write(void *buf,unsigned int nbytes){
	return write(iSocketFD,buf,nbytes);
}
int Socket::Close(){
	if(close(iSocketFD)==-1){
		return -1;
	}	
	return 0;
}
